﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace TimKen.BussLogic
{
    /// <summary>
    /// 联系人业务逻辑操作类
    /// </summary>
    public class LinkManManager
    {
        private readonly TimKen.DataAccess.LinkManDAO dal = new TimKen.DataAccess.LinkManDAO();
        public LinkManManager()
        { }
        #region  成员方法
		/// <summary>
		/// 是否存在该记录
		/// </summary>
		public bool Exists(string CntctCode)
		{
			return dal.Exists(CntctCode);
		}

		/// <summary>
		/// 增加一条数据
		/// </summary>
		public void Add(TimKen.DataEntity.LinkMan model)
		{
			dal.Add(model);
		}

		/// <summary>
		/// 更新一条数据
		/// </summary>
		public void Update(TimKen.DataEntity.LinkMan model)
		{
			dal.Update(model);
		}

		/// <summary>
		/// 删除一条数据
		/// </summary>
		public void Delete(string CntctCode)
		{
			
			dal.Delete(CntctCode);
		}

		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public TimKen.DataEntity.LinkMan GetModel(string CntctCode)
		{
			
			return dal.GetModel(CntctCode);
		}

		/// <summary>
		/// 获得数据列表
		/// </summary>
		public DataSet GetList(string strWhere)
		{
			return dal.GetList(strWhere);
		}

		/// <summary>
		/// 获得数据列表
		/// </summary>
		public DataSet GetAllList()
		{
			return GetList("");
		}

		/// <summary>
		/// 获得数据列表
		/// </summary>
		//public DataSet GetList(int PageSize,int PageIndex,string strWhere)
		//{
			//return dal.GetList(PageSize,PageIndex,strWhere);
		//}

		#endregion  成员方法

        public DataSet GetListByCardCode(string CardCode) 
        {

            return dal.GetList(" CardCode='" + CardCode + "'");
        }

    }
}
